
package com.jf.cloud.delivery.service;

import com.jf.cloud.api.delivery.dto.DeliveryOrderDTO;
import com.jf.cloud.api.delivery.vo.DeliveryOrderFeignVO;
import com.jf.cloud.delivery.model.DeliveryOrder;
import com.jf.cloud.delivery.vo.DeliveryOrderVO;
import com.jf.cloud.delivery.vo.TransportVO;

import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * 订单快递信息
 *
 * @author zz
 * @date 2020-12-07 15:10:00
 */
public interface DeliveryOrderService {

    /**
     * 根据订单快递信息id获取订单快递信息
     *
     * @param deliveryOrderId 订单快递信息id
     * @return 订单快递信息
     */
    DeliveryOrderVO getByDeliveryOrderId(Long deliveryOrderId);

    /**
     * 保存订单快递信息
     * @param deliveryOrder 订单快递信息
     */
    void save(DeliveryOrder deliveryOrder);

    /**
     * 更新订单快递信息
     * @param deliveryOrder 订单快递信息
     */
    void update(DeliveryOrder deliveryOrder);

    /**
     * 根据订单快递信息id删除订单快递信息
     * @param deliveryOrderId
     */
    void deleteById(Long deliveryOrderId);

	/**
	 * 根据订单号获取包裹信息
	 * @param orderId 订单id
	 * @throws UnsupportedEncodingException 编码异常
	 * @return 包裹信息
	 */
	List<DeliveryOrderFeignVO> getByDeliveryByOrderId(Long orderId);

    /**
     * 生成物流信息及保存物流与订单关联
     * @param deliveryOrder 订单发货信息
     */
    void saveDeliveryInfo(DeliveryOrderDTO deliveryOrder);

    /**
     * 查询订单物流包裹信息
     * @param orderId
     * @return
     */
    List<DeliveryOrderVO> listDetailDelivery(Long orderId);

    /**
     * 修改订单物流包裹信息
     * @param list
     */
    void updateOrderDeliveries(List<DeliveryOrderDTO> list);

	/**
	 * 获取物流信息
	 *
	 * @param deliveryOrderId 订单物流包裹id
	 * @return 物流信息
	 */
    DeliveryOrderFeignVO deliveryOrderItemInfo(Long deliveryOrderId);

    /**
     *根据订单编号获取发货数量
     * @param orderIds
     * @return
     */
    List<DeliveryOrderFeignVO> listDeliveryCountByOrderId(List<Long> orderIds);

    /**
     * 判断用户地址是否包含在配送范围内
     */
    Boolean checkAddr(TransportVO transportVO, Long userId, Long addrId);
}
